//
//  UIBarButtonItem+WJUIBarButtonItemExt.m
//  weibo
//
//  Created by 王俊 on 15/12/25.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "UIBarButtonItem+WJUIBarButtonItemExt.h"

@implementation UIBarButtonItem (WJUIBarButtonItemExt)
+ (instancetype)barButtonItemWithImage:(UIImage*)image highlightedImage:(UIImage*)highlightedImage target:(id)target action:(SEL)action
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.bounds = CGRectMake(0, 0, 30, 30);
    [button setImage:image forState:UIControlStateNormal];
    [button setImage:highlightedImage forState:UIControlStateHighlighted];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[UIBarButtonItem alloc]initWithCustomView:button];
    
}

@end
